﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System.Web.Mvc.JQueryValidation
{
	[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
	public abstract class ValidatorAttribute : Attribute
	{
		public string FieldName
		{
			get;
			protected set;
		}

		public string FormID
		{
			get;
			set;
		}

		public string ServerErrorMessage
		{
			get;
			set;
		}

		public abstract string JQueryRule
		{
			get;
		}

		public string JQueryErrorMessage
		{
			get;
			set;
		}

		public abstract string JQueryRuleErrorMessage
		{
			get;
		}

		public abstract bool Validate(string value);

		public ValidatorAttribute(string formID, string fieldName)
		{
			FormID = formID;
			FieldName = fieldName;
		}
	}
}